package com.gitee.wsl.ext.array

import com.gitee.wsl.ext.base.ifValue

fun FloatArray.minSize(newSize:Int,fillValue:Float = 0f) = (this.size < newSize).ifValue(copyOf(newSize).apply { fill(fillValue,this.size,newSize) },this)

fun DoubleArray.minSize(newSize:Int,fillValue:Float = 0f) = (this.size < newSize).ifValue(copyOf(newSize),this)

fun IntArray.minSize(newSize:Int,fillValue:Float = 0f) = (this.size < newSize).ifValue(copyOf(newSize),this)

fun<E> Array<E?>.minSize(newSize:Int,fillValue:Float = 0f) = (this.size < newSize).ifValue(copyOf(newSize),this)